package br.edu.ufabc.gtrnp.helppo.util;

public final class HelppoConstants {

	public static String USUARIO_LOGADO = "usuario_logado";
	public static String HELPPO_FILE_NAME = "/helppo.properties";
	public static char SIM = 'S';
	public static char NAO = 'N';
	public static String UPLOAD_PATH = "path_upload";
	public static String UPLOAD_URL = "url_upload";
	public static String PARAMETRO_SCRIPT = "<URL_HELPPO>";
	public static String FOLDER_NAME = "Helppo";
	
	public static StringBuilder SCRIPT_VIDEO = new StringBuilder();
	
	static{
		SCRIPT_VIDEO.append("float START_TIME = 30.0; \n");
		SCRIPT_VIDEO.append("float RUN_LENGTH = 10.0; \n");
		SCRIPT_VIDEO.append("default \n");
		SCRIPT_VIDEO.append("{ \n");
		SCRIPT_VIDEO.append("state_entry() \n");
		SCRIPT_VIDEO.append("{ \n");
		SCRIPT_VIDEO.append("if ( llParcelMediaQuery([PARCEL_MEDIA_COMMAND_TEXTURE]) == [] ) \n");
		SCRIPT_VIDEO.append("llSay(0, \"Lacking permission to set/query parcel media. This object has to be owned by/deeded to the land owner.\"); \n");
		SCRIPT_VIDEO.append("llParcelMediaCommandList( [ \n");
		SCRIPT_VIDEO.append("PARCEL_MEDIA_COMMAND_URL, \"<URL_HELPPO>\", \n");
		SCRIPT_VIDEO.append("PARCEL_MEDIA_COMMAND_TEXTURE, (key) llGetTexture(0) ] ); \n");
		SCRIPT_VIDEO.append("} \n");
		SCRIPT_VIDEO.append("touch_start(integer num_detected) \n");
		SCRIPT_VIDEO.append("{ \n");
		SCRIPT_VIDEO.append("llParcelMediaCommandList( [ \n");
		SCRIPT_VIDEO.append("PARCEL_MEDIA_COMMAND_AGENT, llDetectedKey(0), \n");
		SCRIPT_VIDEO.append("PARCEL_MEDIA_COMMAND_TIME, START_TIME, \n");
		SCRIPT_VIDEO.append("PARCEL_MEDIA_COMMAND_PLAY ] ); \n");
		SCRIPT_VIDEO.append("list Info = llParcelMediaQuery([PARCEL_MEDIA_COMMAND_URL, PARCEL_MEDIA_COMMAND_TEXTURE]); \n");
		SCRIPT_VIDEO.append("llSay(0, \"Playing '\" + llList2String(Info, 0) + \"' on texture '\" + (string)llList2Key(Info, 1) + \"' for agent \" + llDetectedName(0)); \n");
		SCRIPT_VIDEO.append("llSetTimerEvent(RUN_LENGTH); \n");
		SCRIPT_VIDEO.append("} \n");
		SCRIPT_VIDEO.append("timer() \n");
		SCRIPT_VIDEO.append("{ \n");
		SCRIPT_VIDEO.append("llParcelMediaCommandList( [ PARCEL_MEDIA_COMMAND_STOP ] ); \n");
		SCRIPT_VIDEO.append("llSetTimerEvent(0.0); \n");
		SCRIPT_VIDEO.append("} \n");
		SCRIPT_VIDEO.append("} \n");
	}
}